package com.example.dddsample.application.assembler;

import com.example.dddsample.application.api.response.CustomerResponseDTO;
import com.example.dddsample.application.assembler.mapper.CustomerMapper;
import com.example.dddsample.domain.entity.CustomerAggregate;
import com.example.dddsample.domain.vo.CustomerQueryBaseVO;
import org.springframework.stereotype.Component;

/**
 * @author: bebm
 * @date: 2022/3/29 15:07
 * @description:
 */
@Component
public class CustomerAssembler {

    public CustomerResponseDTO assemblerFromCustomerAggregate
            (CustomerAggregate customerAggregate){
        return CustomerMapper.INST.fromCustomerAggregate(customerAggregate);
    }

    /**
     *
     * @param custName
     * @return CustomerQueryBaseVO
     */
    public CustomerQueryBaseVO assemblerFormCustomerPage(String custName){
        return CustomerQueryBaseVO.builder().custName(custName).build();

    }

}
